//
//  CrmIsArriveShopCell.m
//  New_Runway
//
//  Created by mack on 2018/2/28.
//  Copyright © 2018年 NelsonJ. All rights reserved.
//

#import "CrmIsArriveShopCell.h"

@interface CrmIsArriveShopCell ()
@end

@implementation CrmIsArriveShopCell

- (void)awakeFromNib {
    [super awakeFromNib];
    [self.isYesB setTitleColor:MAIN_NAV_COLOR() forState:UIControlStateSelected];
    [self.isYesB setTitleColor:MAIN_FONT_COLOR() forState:UIControlStateNormal];
    [self.isNoB setTitleColor:MAIN_NAV_COLOR() forState:UIControlStateSelected];
    [self.isNoB setTitleColor:MAIN_FONT_COLOR() forState:UIControlStateNormal];
    [self.isNoB setImage:[UIImage imageNamed:@"crm_seleted_s"] forState:UIControlStateNormal];
    [self.isYesB setImage:[UIImage imageNamed:@"crm_seleted_n"] forState:UIControlStateNormal];
    


}
-(void)setIndex:(NSIndexPath *)index{
    _index = index;
}
- (IBAction)chooseYes:(UIButton *)sender {
    if (self.iscrm == YES) {
        self.isYesB.selected = !self.isYesB.selected;
        self.isNoB.selected = NO;
        
        if (self.isYesB.selected == YES) {
            [self.isYesB setImage:[UIImage imageNamed:@"crm_seleted_s"] forState:UIControlStateNormal];
        } else {
            [self.isYesB setImage:[UIImage imageNamed:@"crm_seleted_n"] forState:UIControlStateNormal];
        }
        
        [self.isNoB setImage:[UIImage imageNamed:@"crm_seleted_n"] forState:UIControlStateNormal];
    }else{
        [self routerEventWithName:@"ISYES" userInfo:@{@"index" : self.index}];
        

    }
   
    


}
- (IBAction)chooseNo:(UIButton *)sender {
    if (self.iscrm == YES) {
        self.isNoB.selected = !self.isNoB.selected;
        self.isYesB.selected = NO;
        if (self.isNoB.selected == YES) {
            [self.isNoB setImage:[UIImage imageNamed:@"crm_seleted_s"] forState:UIControlStateNormal];
        } else {
            [self.isNoB setImage:[UIImage imageNamed:@"crm_seleted_n"] forState:UIControlStateNormal];
        }
        
        [self.isYesB setImage:[UIImage imageNamed:@"crm_seleted_n"] forState:UIControlStateNormal];
    }else{
        [self routerEventWithName:@"ISNO" userInfo:@{@"index" : self.index}];


    }


}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

}

@end
